import Interfaces.ICommandsHandler;
import Messages.MonitorDataTypeEnum;

public class CommandHandler implements ICommandsHandler
{
	ThreadManager TM = new ThreadManager(); 
	
	@Override
	public void HandleRegisterCommand(String monitorIP, int monitorPort,
			MonitorDataTypeEnum monitorDataType, Object[] parameters) {

		/* New thread to monitor the new request */
		TM.Start(monitorIP, monitorPort, monitorDataType, parameters);
		
//		System.out.println("Got register message from " + monitorIP + "on" + monitorDataType.name());		
	}

	@Override
	public void HandleUnregisterCommand(String monitorIP, int monitorPort,
			MonitorDataTypeEnum monitorDataType, Object[] parameters) {

		/* Stopping the relevant thread! */
		TM.Stop(monitorIP, monitorDataType);

//		System.out.println("Got unregister message from " + monitorIP + "on" + monitorDataType.name());
	}

}
